home *** CD-ROM | disk | FTP | other *** search
- Path: mailhub.scitec.com.au!ramsesy
- From: ramsesy@rd.scitec.com.au (Ramses Youhana)
- Newsgroups: comp.lang.c
- Subject: Re: C Coding Standards
- Date: 21 Feb 1996 09:10:25 GMT
- Organization: SCITEC LIMITED, Sydney, Australia.
- Message-ID: <4geni1$o23@mailhub.scitec.com.au>
- References: <4fd3r1$5ae@LNCSEX0003.eu.btco.com> <larry_kearney-0802961600170001@amaryllisp1.appsig.com> <311B704D.39ED@oc.com>
- NNTP-Posting-Host: scitec7.scitec.com.au
- X-Newsreader: TIN [version 1.2 PL2]
-
- Larry Weiss (lfw@oc.com) wrote:
- > > > Anyone know where I can get a start on writing some coding standards...
- > > > I would like to know what need s to be covered. Right now I can think of
- > > >
- > > > 1) Identifier naming conventions
- > > > 2) Headers - code layout- indentation etc
- > > >
- > > > Anyone know of an existing standard which one can adopt ?
-
- > Here are some topics that we cover in our coding standard at work:
- > o module headers (both .c and .h)
- > o function declaration header
- > o variable names (both global and local)
- > o statement typography
- > o statement indention
- > o expression typography
- > o comment (both block and statement level)
- > o function prototype policy
- > o "Hungarian notation" policy
- > o module names
- > o component architecture issues
- > o variable initialization policy
- > o portability issues (type names, memory management isolation, etc.)
- > o conditional compilation policy (#if, #ifdef usage)
- > o makefile issues (dependency usage, -D switch policy, etc)
- > o included file issues (multiple inclusion avoidance policies, etc)
- > o Standard C compliance policy
- > o max module length policy
- > o debugging instrumentation policies (permanence, format, etc)
- > o usage of TAB characters (allowed?, policy if allowed)
-
- Here are some more that we include in our coding standards at work:
- Identifier naming conventions:
- - Constants
- - Macros
- - Variables
- - Functions
- - Typedefs, struct, union and enum
- - Scope of Identifiers
-
- Also for C++ you can add:
- - Class definitions
- - Function overloading
-
- Also sometimes there may be the need to write modules in Assembly code or use inline
- assembly code. For Assembly code you can specify a standard for:
- - Formatting
- - Labels
- - Conditional statements
- - Loops
- - Calling C functions.
-
- I hope this helps.
-
- Ramses.
-
-
-
-
-
-
-